package net.jlibrary.member.action.vo;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import net.jlibrary.common.CoreConstants;
import net.jlibrary.common.core.annotation.VoForPo;
import net.jlibrary.common.core.entity.BaseVo;
import net.jlibrary.member.domain.Member;
import net.jlibrary.parking.domain.Parking;

@VoForPo(Member.class)
public class MemberVo extends BaseVo {
	private static final long serialVersionUID = 4964787706703021956L;
	private Long id;
	private String nickname;
	private String phone;
	private String mailbox;
	private Integer parking_id;

	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT) // 返回时间类型
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT) // 接收时间类型
	private Date startdate;
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT) // 返回时间类型
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT) // 接收时间类型
	private Date enddate;
	private boolean valid;
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date createdate;

	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date lastdate;

	private String nameSearchKey;

	private ParkingVo parking;

	private ParkingVo paringSearchKey;

	public ParkingVo getParingSearchKey() {
		return paringSearchKey;
	}

	public MemberVo() {
		parking = new ParkingVo();
		paringSearchKey = new ParkingVo();
	}

	public void setParingSearchKey(ParkingVo paringSearchKey) {
		this.paringSearchKey = paringSearchKey;
	}

	public String getNameSearchKey() {
		return nameSearchKey;
	}

	public void setNameSearchKey(String nameSearchKey) {
		this.nameSearchKey = nameSearchKey;
	}

	public ParkingVo getParkingVo() {
		return parking;
	}

	public void setParkingVo(ParkingVo parkingVo) {
		this.parking = parkingVo;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getMailbox() {
		return mailbox;
	}

	public void setMailbox(String mailbox) {
		this.mailbox = mailbox;
	}

	public Integer getParking_id() {
		return parking_id;
	}

	public void setParking_id(Integer parking_id) {
		this.parking_id = parking_id;
	}

	public Date getStartdate() {
		return startdate;
	}

	public void setStartdate(Date startdate) {
		this.startdate = startdate;
	}

	public Date getEnddate() {
		return enddate;
	}

	public void setEnddate(Date enddate) {
		this.enddate = enddate;
	}

	public boolean isValid() {
		return valid;
	}

	public void setValid(boolean valid) {
		this.valid = valid;
	}

	public Date getCreatedate() {
		return createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	public Date getLastdate() {
		return lastdate;
	}

	public void setLastdate(Date lastdate) {
		this.lastdate = lastdate;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public Serializable getPrimaryKey() {
		// TODO Auto-generated method stub
		return id;
	}

	@Override
	public Serializable getText() {
		// TODO Auto-generated method stub
		return nickname;
	}

	@VoForPo(Parking.class)
	public class ParkingVo extends BaseVo {
		private static final long serialVersionUID = 4964787706703021956L;
		private Long id;
		private String parkingName;
		private Integer spotNum;
		private String contactPhone;
		private String address;
		private boolean valid;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		public Long getId() {
			return id;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getParkingName() {
			return parkingName;
		}

		public void setParkingName(String parkingName) {
			this.parkingName = parkingName;
		}

		public Integer getSpotNum() {
			return spotNum;
		}

		public void setSpotNum(Integer spotNum) {
			this.spotNum = spotNum;
		}

		public String getContactPhone() {
			return contactPhone;
		}

		public void setContactPhone(String contactPhone) {
			this.contactPhone = contactPhone;
		}

		public String getAddress() {
			return address;
		}

		public void setAddress(String address) {
			this.address = address;
		}

		public boolean isValid() {
			return valid;
		}

		public void setValid(boolean valid) {
			this.valid = valid;
		}

		public Date getCreatedate() {
			return createdate;
		}

		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		public Date getLastdate() {
			return lastdate;
		}

		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}

		@Override
		public Serializable getPrimaryKey() {
			// TODO Auto-generated method stub
			return id;
		}

		@Override
		public Serializable getText() {
			// TODO Auto-generated method stub
			return parkingName;
		}
	}

}
